import { defineBoot } from '#q-app/wrappers'
import { createI18n } from 'vue-i18n'
import messages from 'src/i18n'
import { Quasar } from 'quasar'
import quasarLangZhCN from 'quasar/lang/zh-CN'

export default defineBoot(({ app }) => {
  // 设置 Quasar 框架的语言包
  Quasar.lang.set(quasarLangZhCN)

  const i18n = createI18n({
    locale: 'zh-CN',
    fallbackLocale: 'zh-CN', // 添加后备语言
    globalInjection: true,
    messages,
  })

  // Set i18n instance on app
  app.use(i18n)
})
